package com.mall.shop.entity.product;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mall.shop.annotation.ListValue;
import com.mall.shop.valid.AddGroup;
import com.mall.shop.valid.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.URL;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 品牌(Brand)表实体类
 *
 * @author 龙茶清欢
 * @since 2023-01-16 15:11:28
 */
@Getter
@Setter
@Valid
@Validated
@TableName("pms_brand")
@Schema(name = "品牌实体", description = "品牌映射")
public class Brand implements Serializable {
    private static final long serialVersionUID = -26048723374292285L;

    @TableId(value = "brand_id", type = IdType.AUTO)
    @Schema(description = "品牌id")
    private Long brandId;

    @TableField(value = "name")
    @Schema(description = "品牌名")
    private String name;

    @URL(message = "品牌logo地址必须为url地址")
    @NotBlank(message = "品牌logo地址不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @TableField(value = "logo")
    @Schema(description = "品牌logo地址")
    private String logo;

    @TableField(value = "descript")
    @Schema(description = "介绍")
    private String descript;

    @ListValue(value = {0, 1}, groups = {AddGroup.class, UpdateGroup.class})
    @TableField(value = "show_status")
    @Schema(description = "显示状态[0-不显示；1-显示]")
    private Integer showStatus;

    @TableField(value = "first_letter")
    @Schema(description = "检索首字母")
    private String firstLetter;

    @TableField(value = "sort")
    @Schema(description = "排序")
    private Integer sort;

}

